<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JavaScript异步编程</title>
    <script src="./js/js06_oojs_06.js" async></script>
    <link rel="stylesheet" href="./style/common.css">
</head>
<body>
    <h1>同步阻塞示例</h1>
    <p class="msg"></p>
    <p>
        <button>同步执行函数</button>
        <textarea name="" id="" cols="30" rows="10">点击“同步执行函数”后暂时无法响应，产生阻塞。</textarea>
    </p>
    <script>
        document.addEventListener("DOMContentLoaded",function(){
            let msg=document.querySelector(".msg");
            const btn=document.querySelector("button");
            btn.addEventListener("click",function(){
                done();
                msg.innerHTML+="操作完成";
                let pElem=document.createElement("p");
                pElem.textContent="新增段落";
                document.body.appendChild(pElem);
            });
        });
    </script>
</body>
</html>